import React, {Component} from "react";
import axios from "axios";


export default class App extends Component {

    // 通过设置 "proxy": "http://localhost:5000"
    getStudent=()=>{
         axios.get("http://localhost:3000/students").then((res)=>{
             console.log(res.data)
         },(err)=>{
             console.log(err)
         })
    }

    getCar=()=>{

    }

    render() {
        return (
            <div id="root">
                <button onClick={this.getStudent}>点我获取学生数据</button>
                <button onClick={this.getCar}>点我获取车数据</button>
            </div>
        )
    }
}